package com.zj.test;

/**
 * @program algorithm
 * @description:
 * @author: zhangbo
 * @create: 2022/01/30 03:16
 */
public class Ref {


    public static void main(String[] args) {
        TestRef testRef = new TestRef(1);
        Ref ref = new Ref();
        ref.getA(testRef);
        System.out.println(testRef.toString());
    }

    static class TestRef {
        int a;

        TestRef(int a) {
            this.a = a;
        }

        @Override
        public String toString() {
            return "TestRef{" +
                    "a=" + a +
                    '}';
        }
    }


    public void getA(TestRef ref) {
        ref.a = 2;
    }


}
